from django.db import models

# Create your models here.
class Patrocinador(models.Model):
	#id_ext = models.IntegerField(primary_key=True)
	nombre = models.CharField(max_length=50)

class memo(models.Model):
	id_ext = models.IntegerField(primary_key=True)
	fecha_ini = models.DateTimeField(auto_now_add=True)
	fecha_exp = models.DateField()
	patrocinador = models.ForeignKey(Patrocinador)
	giro = models.CharField(max_length=20)
	producto = models.CharField(max_length=100)
	beneficio = models.CharField(max_length=50)
	evento = models.CharField(max_length=25)
	responsable_marco = models.CharField(max_length=50)
	telefono = models.CharField(max_length=15)
	responsable_area = models.CharField(max_length=50)
	ext_responsable = models.CharField(max_length=4)
	asociacion = models.CharField(max_length=50)
	class Meta:
        	db_table = 'memo'
        	ordering = ['fecha_ini']
    	def __unicode__(self):
        	return self.id_ext

class Semaforo(models.Model):
	nummemo = models.ForeignKey(memo)
	firmauno = models.BooleanField()
	fechafirmuno = models.DateTimeField(null=True)
	comentariosfirmauno = models.CharField(max_length=2000, null = True)
	firmados = models.BooleanField()
	fechafirmdos = models.DateTimeField(null=True)
	comentariosfirmados = models.CharField(max_length=2000, null = True)
	firmatres = models.BooleanField()
	fechafirmtres = models.DateTimeField(null=True)
	comentariosfirmatres = models.CharField(max_length=2000, null = True)
	firmacuatro = models.BooleanField()
	fechafirmcuatro = models.DateTimeField(null=True)
	comentariosfirmacuatro = models.CharField(max_length=2000, null = True)


class fecha_memo(models.Model):
	id_fecha = models.AutoField(primary_key=True)
	id_ext = models.IntegerField()
	fecha = models.DateField()
	tamano = models.CharField(max_length=20)
	autos = models.CharField(max_length=100)
	asistentes = models.CharField(max_length=200)
	descripcion = models.CharField(max_length=300)
